classdef ET_PTB_SIMPLE < ET_PTB
   methods
        function prepareOccluder(self,size,positions)
            % prepareOccluder(self,size,positions)
            self.occluder = OCCLUDER_SIMPLE(self,size,positions);
        end
        function prepareJump(self)
            self.jump = JUMP(self);
            self.jump.m(:) = 0;
        end
        
        function prepareBlocks(self,nb)
            self.num_blocks = nb;
        end
               
        function prepareTrials(self,nt)
            % Create the trials
            %
            % NT    Number of trials
            
            self.num_trials = nt;
            
            self.FpC = ones(self.num_trials,self.num_blocks);
            self.trials = self.FpC;
            % Randomization
            % TODO Make this more robust

            tmp = repmat((1:numel(self.FpClearn))',self.num_trials/numel(self.FpClearn),1);
            for b = 1:self.num_blocks
                self.trials(:,b) = tmp(randperm(self.num_trials));
                self.FpC(:,b) = self.FpClearn(self.trials(:,b));
            end
            self.FpC = self.FpC;
        end
        function prepareFixation(self)
%             self.randomFixation = round(rand(self.num_trials,self.num_blocks));
%             self.randomFixation(self.randomFixation == 0) = -1;
            self.randomFixation = ones(self.num_trials,self.num_blocks) * self.fix.x;
        end 
   end
end